package com.meiqiongproperty.yiguanjia.fragment.pay;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.meiqiongproperty.yiguanjia.R;
import com.meiqiongproperty.yiguanjia.databinding.PayTypeLayoutBinding;
import com.meiqiongproperty.yiguanjia.fragment.BaseFragment;

/**
 * @version V1.0
 * @packge com.meiqiongproperty.yiguanjia.fragment.pay
 * @User ChenJing
 * @Date 2017/5/24
 */

public class PayTypeFragment extends BaseFragment {
    PayTypeLayoutBinding binding;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding= DataBindingUtil.inflate(inflater, R.layout.pay_type_layout,container,false);
        binding.setClick(this);
        initView();
        return binding.getRoot();
    }

    private void initView() {
        binding.navigation.setTitle("支付方式");
        binding.navigation.setLeftClick(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                sendKeyBackEvent();
            }
        });
    }
    public void weixin(View view){
        payTypeClickListener.setData(2);
        dismissSelf();
    }
    public void zhifb(View view){
        payTypeClickListener.setData(1);
        dismissSelf();
    }

    private PayTypeClickListener payTypeClickListener;

    public void setPayTypeClickListener(PayTypeClickListener payTypeClickListener) {
        this.payTypeClickListener = payTypeClickListener;
    }

    public interface PayTypeClickListener {
        public void setData(Object data);
    }
}
